//index.js
//获取应用实例
var app = getApp()
Page({
  data: {
    orderId: 0,
    orderDetail: {}
  },
  onLoad: function (e) {
    var orderId = e.id;
    var orderId = e.id;
    this.setData({
      orderId: orderId
    });
  },
  onShow: function () {
    var that = this;
    wx.request({
      url: app.globalData.host + '/api/order/GetOrder',
      data: {
        uid: app.globalData.userInfo.Uid,
        oid: that.data.orderId
      },
      success: (res) => {
        wx.hideLoading();
        if (res.data.Code != 0) {
          wx.showModal({
            title: '错误',
            content: res.data.Message,
            showCancel: false
          })
          return;
        }
        var order = res.data.Data;
        for (var i = 0; i < order.OrderProductList.length; i++) {
          order.OrderProductList[i].ShowImg = app.globalData.image190_190host + order.OrderProductList[i].ShowImg;

        }
        that.setData({
          orderDetail: order
        });
      }
    })
  },
  onPullDownRefresh: function () {
    // 页面相关事件处理函数--监听用户下拉动作
    wx.stopPullDownRefresh();
  }
})
